﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DCInward_Edit.aspx.cs" Inherits="Main_Inventory_DCInward" Culture="en-GB" %>
<%@ Register Src="~/User Controls/PageHeading.ascx" TagName="heading" TagPrefix="acc" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AjaxControl" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../../Styles/accounts.css" rel="stylesheet" type="text/css" />
    <script src="../../JavaScript/Commons.js" type="text/javascript"></script>
        <script type="text/javascript">
            function Enable() {
                return true;
            }
            function Desable() {
                return false;
            }
            function EnabledTabKey(id, e) {
                var keycode;
                if (window.event) {
                    keycode = window.event.keyCode;
                }
                else if (e) {
                    keycode = e.which;
                }
                else {
                    return true;
                }

                if (keycode == 9) {
                    // if is the tab key                
                    return true;
                }
                else {
                    return false;
                }
            }
            function GetQuantity(hidItemId, CtrlId, HidLocationId) {
                var ddl=document.getElementById(hidItemId).value;
                
                if (ddl != '' && parseFloat(ddl) > 0) {
                    var ctrlIndex = HidLocationId.toString();
                    var LocationIdandQty = document.getElementById(ctrlIndex).value;
                    window.open('DCInwardSaleQty.aspx?ItemId=' + ddl + '&CtrlId=' + CtrlId + '&HidLocationId=' + HidLocationId + '&LocationIdandQty=' + LocationIdandQty, '', 'width=700, height=400, resizable=0');
                }
                else {
                    alert('Choose Item First');
                    return false;
                }
            } 
            
            function CalculateAmtBillLevel() {
                var Count = document.getElementById("hcount").value;
                var TotalQty = 0;
                var TotalAmount = 0;
                var TotalTax = 0;
                for (var i = 1; i <= Count; i++) {
                    var Qty = document.getElementById("txtquantity" + i);
                    var RateAmt = document.getElementById("txtrate" + i);
//                    var TaxRate = document.getElementById("hidTaxRate" + i);
//                    var TaxAmount = document.getElementById("hidtaxamt" + i);
                    var ItemAmount = document.getElementById("txtamount" + i);
                    var itemAmt = 0;
                    var taxAmt = 0;
                    if (Qty.value != '' && parseFloat(Qty.value) > 0) {
                        TotalQty += parseFloat(Qty.value);
                        if (RateAmt.value != '' && parseFloat(RateAmt.value) > 0) {
                            itemAmt = parseFloat(Qty.value) * parseFloat(RateAmt.value);
                            //TotalAmount += parseFloat(itemAmt);

//                            if (TaxRate.value != '' && parseFloat(TaxRate.value) > 0) {
//                                taxAmt = (parseFloat(itemAmt) * parseFloat(TaxRate.value)) / 100;
//                            }
//                            TotalTax += parseFloat(taxAmt);
                        }
                        document.getElementById("txtamount" + i).value = parseFloat(itemAmt).toFixed(2);
                        //document.getElementById("hidTaxAmtBillLevel" + i).value = parseFloat(taxAmt).toFixed(2);
                    }
                }
            }
            function ValidateItems() {
                var flag = true;
                if (document.getElementById("ddldcformate").selectedIndex == 0) {
                    alert('Please Select Bill Format ');
                    document.getElementById("ddldcformate").focus();
                    flag = false;
                }
                else if (document.getElementById("ddlSupplier").selectedIndex == 0) {
                    alert('Please Select Supplier ');
                    document.getElementById("ddlSupplier").focus();
                    flag = false;
                }
                else if (document.getElementById("txtVoucher").value == '' || document.getElementById("txtVoucher").value == 'Number') {
                    alert('Please Specify Voucher Number');
                    document.getElementById("txtVoucher").focus();
                    flag = false;
                }
                else if (document.getElementById("ddltaxgroup").selectedIndex == 0) {
                    alert('Please Select Tax Group ');
                    document.getElementById("ddltaxgroup").focus();
                    flag = false;
                }
                else if (document.getElementById("txtDate").value == '' || document.getElementById("txtDate").value == '__/__/____') {
                    alert('Please Specify  Date');
                    document.getElementById("txtDate").focus();
                    flag = false;
                }
                else if (document.getElementById("ddlItems1").selectedIndex == 0) {
                    alert('Please Select At Least One Item ');
                    document.getElementById("ddlItems1").focus();
                    flag = false;
                }
                else if (document.getElementById("txtquantity1").value == '') {
                    alert('Please Specify Quantity For First Item');
                    document.getElementById("txtquantity1").focus();
                    flag = false;
                }
                else if (document.getElementById("txtrate1").value == '') {
                    alert('Please Specify Rate Inclusive Tax');
                    document.getElementById("txtrate1").focus();
                    flag = false;
                }
                else if (document.getElementById("hidCheckDelivery").value == 'True') {
                    if (document.getElementById("txtdeliverydate").value == '' || document.getElementById("txtdeliverydate").value == '__/__/____') {
                        alert('Please Specify Delivery Date');
                        document.getElementById("txtdeliverydate").focus();
                        flag = false;
                    }
                }
                return flag;
            }
            function ValidateItems1() {
                var flag = true;
                var Count = document.getElementById("hcount").value;
                for (var i = 2; i <= Count; i++) {
                    if (document.getElementById("ddlItems" + i).selectedIndex != 0) {
                        if (document.getElementById("txtquantity" + i).value == '') {
                            alert('Please Specify Quantity at Row No ' + ' ' + i);
                            document.getElementById("txtquantity" + i).focus();
                            flag = false;
                        }
                        if (document.getElementById("txtrate" + i).value == '') {
                            alert('Please Specify Rate Inclusive Tax at Row No ' + ' ' + i);
                            document.getElementById("txtrate" + i).focus();
                            flag = false;
                        }
                    }
                    else if (document.getElementById("txtquantity" + i).value != '') {
                        if (document.getElementById("ddlItems" + i).selectedIndex == 0) {
                            alert('Please Specify Item in Row No ' + ' ' + i);
                            document.getElementById("ddlItems" + i).focus();
                            flag = false;
                        }
                        if (document.getElementById("txtrate" + i).value == '') {
                            alert('Please Specify Rate Inclusive Tax at Row No ' + ' ' + i);
                            document.getElementById("txtrate" + i).focus();
                            flag = false;
                        }
                    }
                    else if (document.getElementById("txtrate" + i).value != '') {
                        if (document.getElementById("txtquantity" + i).value == '') {
                            alert('Please Specify Quantity in Row No ' + ' ' + i);
                            document.getElementById("txtquantity" + i).focus();
                            flag = false;
                        }
                        else if (document.getElementById("ddlItems" + i).selectedIndex == 0) {
                            alert('Please Specify Item in Row No ' + ' ' + i);
                            document.getElementById("ddlItems" + i).focus();
                            flag = false;
                        }
                    }
                    
                }
                return flag;
            }

            function ValidationInput() {
                if (ValidateItems() == true && ValidateItems1() == true) {
                    return true;
                }
                else {
                    return false;
                }
            }

            function checkItemRepetion(id) {
              var flag=true;
                var ddl = document.getElementById(id);
                var unitno=id.toString().substring(8);
                var currentValue = ddl.options[ddl.selectedIndex].value;
                var Count = document.getElementById("hcount").value;
                for (var i = 1; i <= Count; i++) {
                    var previous = document.getElementById("ddlItems" + i);
                    var previousValue = previous.options[previous.selectedIndex].value;
                    if(ddl.value=='0')
                    {
                      document.getElementById("txtunit"+unitno).value='';
                      document.getElementById("txtquantity"+unitno).value='';
                      document.getElementById("hidLocationBillLevel"+unitno).value='';
                      document.getElementById("txtrate"+unitno).value='';
                      document.getElementById("txtamount"+unitno).value='';
                      flag=false;
                    }
                    else if (ddl != previous) {
                        if (currentValue == previousValue) {
                            alert('Please Select Unique Item');
                            ddl.selectedIndex = 0;
                            flag=false;
                            break;
                        }
                    }
                }
               if(flag==true)
               {
                 setTimeout('__doPostBack(\''+ddl+'\',\'\')', 0);
               }
                return flag;
            }
//            function Open_DCInward_Details(poid, transferedid, supplier, taxgroup, trnid) {
//                //window.open("Purchase_Recive_Details.aspx?poid=" + poid + "&transferedid=" + transferedid + "&supplier=" + supplier + "&taxgroup=" + taxgroup + ",&trnid=" + trnid + "", 'PurchaseInvoice', 'width=800,height=600,toolbar=no,status=yes,menubar=no,scrollbars=yes,resizable=yes');
//                window.open("DCInward_Details.aspx?poid=" + poid + "&transferedid=" + transferedid + "&supplier=" + supplier + "&taxgroup=" + taxgroup + ",&trnid=" + trnid + "", "");
            //            }
                                            //TFOID,VendCust_Lid,TRNID,FINYEAR
            function Open_DCInward_Details(formateid, supplierid, trnid, finyear) {
                //window.open("Purchase_Recive_Details.aspx?poid=" + poid + "&transferedid=" + transferedid + "&supplier=" + supplier + "&taxgroup=" + taxgroup + ",&trnid=" + trnid + "", 'PurchaseInvoice', 'width=800,height=600,toolbar=no,status=yes,menubar=no,scrollbars=yes,resizable=yes');
                //window.open("DCInward_Details.aspx?TFOID=" + formateid + "&VendCust_Lid=" + supplierid + "&TRNID=" + trnid + "&FINYEAR=" + finyear + "");
                window.open("InventoryPrint/DcInward_Print.aspx?TFOID=" + formateid + "&VendCust_Lid=" + supplierid + "&TRNID=" + trnid + "&FINYEAR=" + finyear + "");
            }
            function open_DCIward_DeliveryAdd(txtdeliveryadd){
               if((document.getElementById("ddlsupplier").value)!="0")
                 {
                   var supp_id=document.getElementById("ddlsupplier").value;
                   window.open("DCInward_DeliveryAdd.aspx?returnTextbox="+txtdeliveryadd+"&suppid="+supp_id+"",'');
                   return true;
                 }
                 else
                 {
                   alert("Please Select Supplier First !");
                   document.getElementById("ddlsupplier").focus();
                    return false;
                 }
            }
        </script>
</head>
<body>
    <form id="form1" runat="server">
     <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>
      <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:UpdateProgress ID="UpdateProgress1" runat="server">
                <ProgressTemplate>
                    <center>
                        <img src="../../Images/ajax-loader.gif" alt="Loading...." /></center>
                </ProgressTemplate>
            </asp:UpdateProgress>
     <div class="divmain" style="width:95%; margin-left:3%;">
        <acc:heading ID="pagehead" runat="server" HeadingText="DC Inward Edit" />   
     <div style="margin-left:10%; margin-right:3%; width:85%" align="center">
        <asp:Label ID="lblMsg" runat="server" Font-Bold="true"></asp:Label>
     </div>   
     </div>
    <div style="width:98%; margin-left:3%;">
    <asp:HiddenField ID="hidCheckDelivery" runat="server" Value="True" />
    <asp:HiddenField ID="hidTRNID" runat="server" />
    <asp:HiddenField ID="hidTIDIDCollection" runat="server" />
       <table class="tablecontent" style="width:110%">
         <tr>
           <td colspan="2" style="width:100%;" class="headtd"> DC Inward Edit</td>
         </tr>
          <tr>
             <td style="width:35%; height:20%;">
                     <table class="tablecontent" style="width:100%; margin-top:2px; ">
                         <tr>
                            <td>DC Format  <span style="color:Red">*</span></td><td>
                             <asp:DropDownList ID="ddldcformate" runat="server" onselectedindexchanged="ddldcformate_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList></td>
                         </tr>
                         <tr>
                               <td>DC No.<span style="color:Red">*</span></td>
                               <td>
                                    <asp:TextBox ID="txtPrefix" runat="server" Width="70px" CssClass="input" onKeyPress="return false" onKeydown="return false"></asp:TextBox>
                                    <AjaxControl:TextBoxWatermarkExtender ID="prefixWater" runat="server" TargetControlID="txtPrefix" WatermarkText="Prefix" WatermarkCssClass="watermark_textbox"></AjaxControl:TextBoxWatermarkExtender>
                                    <asp:TextBox ID="txtVoucher" runat="server" Width="70px" CssClass="inputnumber" ValidationGroup="V" MaxLength="10"  ></asp:TextBox>
                                    <AjaxControl:TextBoxWatermarkExtender ID="voucherWater" runat="server" TargetControlID="txtVoucher" WatermarkText="Number" WatermarkCssClass="watermark_textbox"></AjaxControl:TextBoxWatermarkExtender>                            
                                    <asp:TextBox ID="txtSuffix" runat="server" Width="70px" CssClass="input" onKeyPress="return false" onKeydown="return false"></asp:TextBox>
                                    <AjaxControl:TextBoxWatermarkExtender ID="suffixWater" runat="server" TargetControlID="txtSuffix" WatermarkText="Suffix" WatermarkCssClass="watermark_textbox"></AjaxControl:TextBoxWatermarkExtender>
                               </td>
                         </tr>
                         <tr>
                           <td>Date <span style="color:Red">*</span></td><td><asp:TextBox ID="txtdate" runat="server"></asp:TextBox>
                                <%--<asp:RequiredFieldValidator ID="reqDate" runat="server" ControlToValidate="txtDate" ValidationGroup="V" SetFocusOnError="true" Display="Dynamic"></asp:RequiredFieldValidator>--%>&nbsp;
                                <asp:ImageButton ID="btnDate" runat="server" ImageUrl="~/Images/calendar.gif" />
                                <AjaxControl:CalendarExtender ID="cal" runat="server" PopupButtonID="btnDate" TargetControlID="txtdate" Format="dd/MM/yyyy"></AjaxControl:CalendarExtender>
                                <AjaxControl:MaskedEditExtender ID="maskExt" runat="server" MaskType="Date" Mask="99/99/9999" TargetControlID="txtdate" CultureName="pt-BR"></AjaxControl:MaskedEditExtender>
                                <AjaxControl:MaskedEditValidator ID="maskValid" runat="server" ControlExtender="maskExt" InvalidValueMessage="Invalid Date" IsValidEmpty="true" Display="Dynamic" ValidationGroup="V" ControlToValidate="txtdate"></AjaxControl:MaskedEditValidator>   
                           </td>
                         </tr>
                     </table>
             </td>
             <td style="width:60%; height:20%;">
                <table class="tablecontent" style="width:100%;" >
                       <tr>
                           <td>Supplier  <span style="color:Red">*</span></td><td>
                                 <asp:DropDownList ID="ddlsupplier" runat="server" AutoPostBack="true" 
                                     onselectedindexchanged="ddlsupplier_SelectedIndexChanged"></asp:DropDownList></td><td align="left" style="width:15px;">
                                     <asp:Button ID="btndeliveryadd" runat="server" CssClass="button" 
                                         Text="Delivery Add"  
                                         OnClientClick="open_DCIward_DeliveryAdd('txtdeliveryadd');" 
                                         CausesValidation="False"> </asp:Button></td><td rowspan="4" valign="top" align="left" ><asp:TextBox ID="txtdeliveryadd" runat="server" TextMode="MultiLine" ></asp:TextBox>
                                     <asp:HiddenField ID="hiddelivery_id" runat="server" />
                                     </td>
                       </tr>
                       <tr>
                           <td >Tax Group  <span style="color:Red">*</span></td><td ><asp:DropDownList ID="ddltaxgroup" runat="server" AutoPostBack="true"></asp:DropDownList></td>
                       </tr>
                       <tr>
                           <td>Category  <span style="color:Red">*</span></td><td><asp:DropDownList ID="ddlcategory" runat="server" Enabled="false"></asp:DropDownList></td>
                       </tr>              
                </table>
            </td>
            </tr>
            <tr>
            <td style="width:100%;" colspan="2">
              <table  class="tablecontent"  style="width:100%; border:1px solid #818181; margin-top:10px; margin-bottom:10px;">
                 <tr>
                   <td style="width:100%;">
                   <asp:HiddenField ID="hcount" Value="2" runat="server" /> 
                   <table id="tblitem" runat="server" class="tablecontent" style="width:98%; margin:3px;">
                     <tr>
                       <td style="width:10%; border-right:1px solid #818181; border-bottom:1px solid #818181; text-align:center; font-weight:bold" class="headtd"><b>Item (s)</b></td>
                       <td style="width:10%; border-right:1px solid #818181; border-bottom:1px solid #818181; text-align:center; font-weight:bold" class="headtd"><b>Unit</b></td>
                       <td style="width:13%; border-right:1px solid #818181; border-bottom:1px solid #818181; text-align:center; font-weight:bold" class="headtd"><b>Quantity</b></td>
                       <td style="width:10%; border-right:1px solid #818181; border-bottom:1px solid #818181; text-align:center; font-weight:bold" class="headtd"><b>Rate</b></td>
                       <td style="width:10%; border-bottom:1px solid #818181; text-align:center; font-weight:bold" class="headtd"><b>Amount</b></td>
                     </tr>
                     <tr>
                           <td align="center"><asp:DropDownList ID="ddlitems1" runat="server" CssClass="dropdown" onchange="return checkItemRepetion(this.id);" OnSelectedIndexChanged="ddlitems_OnSelectedIndexChanged" Width="95%"  AutoPostBack="true"></asp:DropDownList>
                           <asp:HiddenField ID="hidTITID1" runat="server" />
                           <asp:HiddenField ID="hidTIDID1" runat="server" />
                           </td>
                           <td align="center"><asp:TextBox ID="txtunit1" runat="server" CssClass="input" style="width:95%;"  OnKeyDown="return EnabledTabKey(this.ID,event);" /><asp:HiddenField ID="huomid1" runat="server" /></td>
                           <td align="center"><asp:TextBox ID="txtquantity1" runat="server" CssClass="inputnumber" style="width:88%;" OnKeyDown="return EnabledTabKey(this.ID,event);" /> <asp:Button ID="btnQtyBillLevel1" runat="server" Text="..."  Width="5%" CssClass="button" /><asp:HiddenField ID="hidLocationBillLevel1" runat="server" /></td>
                           <td align="center"><asp:TextBox ID="txtrate1" runat="server" CssClass="inputnumber" style="width:95%;" OnKeyPress="return isNumberKey(this.ID,event);" onBlur="return CalculateAmtBillLevel();" /><asp:HiddenField ID="hidTaxRate1" runat="server" /></td>
                           <td align="center"><asp:TextBox ID="txtamount1" runat="server" CssClass="inputnumber" style="width:95%;" OnKeyDown="return EnabledTabKey(this.ID,event);" /><asp:HiddenField ID="hidtaxamt1" runat="server" /></td>
                     </tr>
                      <tr>
                           <td align="center"><asp:DropDownList ID="ddlitems2" runat="server" CssClass="dropdown"  OnSelectedIndexChanged="ddlitems_OnSelectedIndexChanged" Width="95%"  onchange="return checkItemRepetion(this.id);" AutoPostBack="true"></asp:DropDownList>
                           <asp:HiddenField ID="hidTITID2" runat="server" />
                           <asp:HiddenField ID="hidTIDID2" runat="server" />
                           </td>
                           <td align="center"><asp:TextBox ID="txtunit2" CssClass="input" runat="server" style="width:95%;" OnKeyDown="return EnabledTabKey(this.ID,event);" /><asp:HiddenField ID="huomid2" runat="server" /></td>
                           <td align="center"><asp:TextBox ID="txtquantity2" runat="server" CssClass="inputnumber" style="width:88%;" OnKeyDown="return EnabledTabKey(this.ID,event);"  /> <asp:Button ID="btnQtyBillLevel2" runat="server" Text="..."  Width="5%"  CssClass="button" /><asp:HiddenField ID="hidLocationBillLevel2" runat="server" /></td>
                           <td align="center"><asp:TextBox ID="txtrate2" runat="server" CssClass="inputnumber" style="width:95%;" OnKeyPress="return isNumberKey(this.ID,event);" onBlur="return CalculateAmtBillLevel();" /><asp:HiddenField ID="hidTaxRate2" runat="server" /></td>
                           <td align="center"><asp:TextBox ID="txtamount2" runat="server" CssClass="inputnumber" style="width:95%;" OnKeyDown="return EnabledTabKey(this.ID,event);" /><asp:HiddenField ID="hidtaxamt2" runat="server" /></td>
                     </tr>
                   </table>
                     <table style="width:90%; margin-top:5px;" align="right">
                            <tr>
                                <td > 
                                    <asp:LinkButton ID="btnAddMore" runat="server" onclick="btnAddMore_Click"> 
                                        <img src="../../Images/More.jpg" alt="Add New Row" />
                                    </asp:LinkButton> 
                                </td>
                            </tr>
                    </table>
                   </td>
                 </tr>
             </table>
             <table style="width:100%;" class="tablecontent" id="divdeliverydetails" runat="server" >
                <tr>
                   <td class="headtd" style="width:100%;" colspan="4"><b>Delivery Details</b></td>
                </tr>
                <tr>
                  <td>Mode Of Delivery</td><td><asp:TextBox ID="txtmodeofdelivery" runat="server"></asp:TextBox></td><td>Freight Indicator</td><td><asp:TextBox ID="txtfreightindicator" runat="server"></asp:TextBox></td>
                </tr>
                <tr>
                  <td>Transporter Name</td><td><asp:TextBox ID="txttransportername" runat="server"></asp:TextBox></td><td>Document No.</td><td><asp:TextBox ID="txtdocumentno" runat="server"></asp:TextBox></td>
                </tr>
                <tr >
                  <td>Delivery Date <span id="spanRequireDate" runat="server" style="color:Red">*</span></td><td><asp:TextBox ID="txtdeliverydate" runat="server"></asp:TextBox>
                    <asp:ImageButton ID="btnimage" runat="server" ImageUrl="~/Images/calendar.gif" />
                    <AjaxControl:CalendarExtender ID="CalendarExtender1" runat="server" PopupButtonID="btnimage" TargetControlID="txtdeliverydate" Format="dd/MM/yyyy"></AjaxControl:CalendarExtender>
                    <AjaxControl:MaskedEditExtender ID="MaskedEditExtender1" runat="server" MaskType="Date" Mask="99/99/9999" TargetControlID="txtdeliverydate" CultureName="pt-BR"></AjaxControl:MaskedEditExtender>
                    <AjaxControl:MaskedEditValidator ID="MaskedEditValidator1" runat="server" ControlExtender="maskExt" InvalidValueMessage="Invalid Date" IsValidEmpty="true" Display="Dynamic" ValidationGroup="V" ControlToValidate="txtdeliverydate"></AjaxControl:MaskedEditValidator>   
                  </td><td>Vehicle No</td><td><asp:TextBox ID="txtvehicleno" runat="server"></asp:TextBox></td>
                </tr>
             </table>
             <table style="width:100%; margin-top:15px;" class="tablecontent">
                <tr>
                   <td class="headtd" style="width:100%;" colspan="4"><b>Other Details</b></td>
                </tr>
                <tr>
                  <td id="tdpreparedby" runat="server">Prepared By</td><td id="tdpreparedbyvlaue" runat="server"><asp:TextBox ID="txtpreparedby" runat="server"></asp:TextBox></td><td id="tdcheckedby" runat="server">Checked By</td><td id="tdcheckedbyvalue" runat="server"><asp:TextBox ID="txtcheckedby" runat="server"></asp:TextBox></td>
                </tr>
                <tr>
                  <td id="tdauthorisedby" runat="server">Authorised Signature</td><td id="tdauthorisedbyvalue" runat="server"><asp:TextBox ID="txtauthorisedsignature" runat="server"></asp:TextBox></td><td id="tdnote" runat="server">Note</td><td id="tdnotevalue" runat="server"><asp:TextBox ID="txtnote" runat="server"></asp:TextBox></td>
                </tr>
                <tr>
                  <td id="tdremarks" runat="server">Remarks</td><td  colspan="3" id="tdremarksvalue" runat="server"><asp:TextBox ID="txtremarks" runat="server" style="width:83%;"></asp:TextBox></td>
                </tr>
             </table>
            </td>
          </tr>
       </table>
       <table style="width:90%;" >
                    <tr>
                        <td align="center"> 
                            <asp:Button ID="btnSave" Text="Update" runat="server" CssClass="button"  
                                ValidationGroup="V" OnClientClick="return ValidationInput();" OnClick="btnSave_Click"/> &nbsp;
                            <asp:Button ID="btnCancel" Text="Cancel" runat="server" CssClass="button" 
                                onclick="btnCancel_Click" /> 
                        </td>
                    </tr>
            </table>
    </div>
    <%--<div style="width:98%; margin-left:3%; margin-top:15px;">
       <table  style="width:100%;">
          <tr>
            <td style="width:100%;">
                <asp:GridView ID="grdview" runat="server" Width="95%" CssClass="gridview" AlternatingRowStyle-CssClass="gridview_alternate" onrowdatabound="grdview_RowDataBound" DataKeyNames="TFOID,VendCust_Lid,TRNID,FINYEAR" AutoGenerateColumns="false">
                     <Columns>
                     <asp:TemplateField HeaderText="Sr No.">
                          <ItemTemplate>
                          <%#Container.DataItemIndex+1 %>
                          </ItemTemplate>
                          <ItemStyle HorizontalAlign="Center"/>
                       </asp:TemplateField>
                       <asp:TemplateField HeaderText="DC Formate">
                          <ItemTemplate>
                             <asp:Label ID="lbldcfomate" runat="server" Text='<%#Eval("TFOID") %>'></asp:Label>
                          </ItemTemplate>
                       </asp:TemplateField>
                       <asp:TemplateField HeaderText="Supplier">
                          <ItemTemplate>
                             <asp:Label ID="lblsupplier" runat="server" Text='<%#Eval("VendCust_Lid") %>'></asp:Label>
                          </ItemTemplate>
                       </asp:TemplateField>
                       <asp:TemplateField HeaderText="Tax Group">
                          <ItemTemplate>
                             <asp:Label ID="lbltaxgroup" runat="server" Text='<%#Eval("DcTax_SubClassid") %>'></asp:Label>
                          </ItemTemplate>
                       </asp:TemplateField>
                       <asp:TemplateField HeaderText="Date">
                          <ItemTemplate>
                             <asp:Label ID="lbldate" runat="server" Text='<%#Eval("TrnDate","{0:dd/M/yyyy}") %>'></asp:Label>
                          </ItemTemplate>
                          <ItemStyle HorizontalAlign="Center"/>
                       </asp:TemplateField>
                       <asp:TemplateField HeaderText="Details">
                           <ItemTemplate>
                              <asp:HyperLink ID="hypdetails" runat="server" NavigateUrl="#" Text="Details"></asp:HyperLink>
                           </ItemTemplate>
                           <ItemStyle HorizontalAlign="Center"/>
                       </asp:TemplateField>
                     </Columns>
                </asp:GridView>
            </td>
          </tr>
       </table>
    </div>--%>
          </ContentTemplate>
  </asp:UpdatePanel> 
  </form>
</body>
</html>
